// 跳转详情
const onDetail = () => {
 window.location.href = '/goods/views/details.html'
}

class onValue {
 searchDom = '';
 close = ''
 constructor(btn = 'i-close', input = 'value') {
  this.searchDom = document.getElementsByClassName(input)[0]
  this.close = document.getElementsByClassName(btn)[0]
 }
 onInput() {
  this.searchDom.addEventListener('input', e => {
   const value = e.target.value

   this.close.style.display = value ? 'block' : 'none'
  })
 }
 onClose() {
  this.close.addEventListener('click', e => {
   this.searchDom.value = ''
   this.close.style.display = 'none'
  })
 }
}
